#include "IA_Factory.hpp"
#include "core/constantes.h"
#include "core/D4F.h"
#include "core/RetF.h"

#include <iostream>
#include <string>

IA_Factory::IA_Factory(){
    list_modules = initTest();
    on_newModule();//fonction appelée à chaque nouvelle techno récupérée
    afficheResultat();
}

IA_Factory::~IA_Factory(){
}
/*
RetF IA_Factory::process (D4F entrer){
    //analyse des communications
    long ressources = entrer.m_ressource;
    k=k+1;
    if(k==1){
        //ou remplacer par pathfinding stuff
        Landscape land;
        int mapWidth;
        int mapHeight;
        int nbPlayers;
        int nbInitRes;
        MapLoader::loadMap(Test-7x7.txt, land, mapWidth, mapHeight,nbPlayers, nbInitRes);
    }

}*/

void IA_Factory::on_newModule(){

    int temp1;
    int temp2;
    int temp3;
    long compar1;
    long compar2;
    long compar3;
    long compar4;
    //Peon:

        //déplacements:
    temp1 = 0;
    compar1 = 40;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_MOVE){
            if (list_modules[i].m_speed==1){
                if (list_modules[i].m_prod_time*3+list_modules[i].m_cost<=compar1){
                    temp1 = i;
                    compar1 = list_modules[i].m_prod_time*3+list_modules[i].m_cost;
                }
            }
        }
    }
    m_Peon.m_module_array.push_back(list_modules[temp1]);
        //armes:
        //autres:
    temp1 = 0;
    temp2 = 0;
    compar1 = 2;
    compar2 = 40;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_OTHER){
            if (list_modules[i].m_weight==1){
                if (list_modules[i].m_cargo_size>=compar1){
                    temp1 = i;
                    compar1 = list_modules[i].m_cargo_size;
                }
            }
            if (list_modules[i].m_weight==-2){
                if (list_modules[i].m_prod_time*3+list_modules[i].m_cost<=compar2){
                    temp2 = i;
                    compar2 = list_modules[i].m_prod_time*3+list_modules[i].m_cost;
                }
            }
        }
    }
    m_Peon.m_module_array.push_back(list_modules[temp1]);
    m_Peon.m_module_array.push_back(list_modules[temp1]);
    m_Peon.m_module_array.push_back(list_modules[temp2]);
    m_Peon.m_module_array.push_back(list_modules[temp2]);
        //



    //Peonvolant:

        //déplacements:
    temp1 = 0;
    compar1 = 2;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_MOVE){
            if (list_modules[i].m_aerial){
                if (list_modules[i].m_speed<=compar1){
                    temp1 = i;
                    compar1 = list_modules[i].m_speed;
                }
            }
        }
    }
    m_PeonVolant.m_module_array.push_back(list_modules[temp1]);
        //armes:
        //autres:
    temp1 = 0;
    temp2 = 0;
    compar1 = 2;
    compar2 = 40;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_OTHER){
            if (list_modules[i].m_weight==1){
                if (list_modules[i].m_cargo_size>=compar1){
                    temp1 = i;
                    compar1 = list_modules[i].m_cargo_size;
                }
            }

            if (list_modules[i].m_weight==-2){
                if (list_modules[i].m_prod_time*3+list_modules[i].m_cost<=compar2){
                    temp2 = i;
                    compar2 = list_modules[i].m_prod_time*3+list_modules[i].m_cost;
                }
            }
        }
    }
    m_PeonVolant.m_module_array.push_back(list_modules[temp1]);
    m_PeonVolant.m_module_array.push_back(list_modules[temp1]);
    m_PeonVolant.m_module_array.push_back(list_modules[temp2]);
    m_PeonVolant.m_module_array.push_back(list_modules[temp2]);
        //

    //Chinois:

        //déplacements:
    temp1 = 0;
    compar1 = 3;
    compar2 = 1;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_MOVE){
            if (list_modules[i].m_speed<=compar1){
                if (list_modules[i].m_cost<=compar2){
                    temp1 = i;
                    compar1 = list_modules[i].m_speed;
                    compar2 = list_modules[i].m_cost;
                }
            }
        }
    }
    m_Chinois.m_module_array.push_back(list_modules[temp1]);
    //armes:
    temp1 = 0;
    compar2 = 3;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_WEAPON){
            if (list_modules[i].m_attack>=compar2 && list_modules[i].m_cost<=0 && list_modules[i].m_min_reach<=1){
                temp1 = i;
                compar1 = list_modules[i].m_weight;
                compar2 = list_modules[i].m_attack;
            }
        }
    }
    m_Chinois.m_module_array.push_back(list_modules[temp1]);
        //autres:
    temp1 = 0;
    temp2 = 0;
    compar1 = 5;
    compar2 = 1;
    compar3 = 5;
    for (int i = 0; i < list_modules.size();i++) {
        if (list_modules[i].m_type==M_OTHER){
            if (list_modules[i].m_cost<=-3){
                if (list_modules[i].m_health_point>=-5 && list_modules[i].m_weight<=0 && list_modules[i].m_prod_time<=compar1){
                    temp1 = i;
                    compar1 = list_modules[i].m_prod_time;
                }
                if (list_modules[i].m_health_point>=2 && list_modules[i].m_weight<=compar2 && list_modules[i].m_prod_time<=compar3 ){
                    temp2 = i;
                    compar2 = list_modules[i].m_weight;
                    compar3 = list_modules[i].m_prod_time;
                }
            }

        }
    }
    m_Chinois.m_module_array.push_back(list_modules[temp1]);
    m_Chinois.m_module_array.push_back(list_modules[temp2]);
    m_Chinois.m_module_array.push_back(list_modules[temp2]);
        //


//Chinois volant:

        //déplacements:
    temp1 = 0;
    compar1 = 2;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_MOVE){
            if (list_modules[i].m_aerial){
                if (list_modules[i].m_speed<=compar1){
                    temp1 = i;
                    compar1 = list_modules[i].m_speed;
                }
            }
        }
    }
    m_ChinoisVolant.m_module_array.push_back(list_modules[temp1]);
    //armes:
    temp1 = 0;
    compar2 = 3;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_WEAPON){
            if (list_modules[i].m_attack>=compar2 && list_modules[i].m_min_reach<=1 && list_modules[i].m_cost<=0){
                temp1 = i;
                compar2 = list_modules[i].m_attack;
            }
        }
    }
    m_ChinoisVolant.m_module_array.push_back(list_modules[temp1]);
        //autres:
    temp1 = 0;
    temp2 = 0;
    compar1 = 5;
    compar2 = 1;
    compar3 = 5;
    for (int i = 0; i < list_modules.size();i++) {
        if (list_modules[i].m_type==M_OTHER){
            if (list_modules[i].m_cost<=-3){
                if (list_modules[i].m_health_point>=-5 && list_modules[i].m_weight<=0 && list_modules[i].m_prod_time<=compar1){
                    temp1 = i;
                    compar1 = list_modules[i].m_prod_time;
                }
                if (list_modules[i].m_health_point>=2 && list_modules[i].m_weight<=compar2 && list_modules[i].m_prod_time<=compar3 ){
                    temp2 = i;
                    compar2 = list_modules[i].m_weight;
                    compar3 = list_modules[i].m_prod_time;
                }
            }

        }
    }
    m_ChinoisVolant.m_module_array.push_back(list_modules[temp1]);
    m_ChinoisVolant.m_module_array.push_back(list_modules[temp2]);
    m_ChinoisVolant.m_module_array.push_back(list_modules[temp2]);
        //

    //Japonais:

        //déplacements:
    temp1 = 0;
    compar1 = 3;
    compar2 = 0;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_MOVE){
            if (list_modules[i].m_speed<=compar1){
                if (list_modules[i].m_cost<=compar2){
                    temp1 = i;
                    compar1 = list_modules[i].m_speed;
                    compar2 = list_modules[i].m_cost;
                }
            }
        }
    }
    m_Japonais.m_module_array.push_back(list_modules[temp1]);
        //autres:
    temp1 = 0;
    compar3 = 5;
    for (int i = 0; i < list_modules.size();i++) {
        if (list_modules[i].m_type==M_OTHER){
            if (list_modules[i].m_explosive>=10 && list_modules[i].m_weight <= 1 && list_modules[i].m_prod_time<=0){
                if (list_modules[i].m_cost <=compar3){
                    temp1 = i;
                    compar3 = list_modules[i].m_prod_time;
                }
            }

        }
    }
    m_Japonais.m_module_array.push_back(list_modules[temp1]);
        //

//Explorateur volant:
    m_ExplorateurVolant.m_module_array.clear();
        //déplacements:
    temp1 = 0;
    compar1 = 2;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_MOVE){
            if (list_modules[i].m_aerial){
                if (list_modules[i].m_speed<=compar1){
                    temp1 = i;
                    compar1 = list_modules[i].m_speed;
                }
            }
        }
    }
    m_ExplorateurVolant.m_module_array.push_back(list_modules[temp1]);
    //armes:
    //autres:
    temp1 = 0;
    temp2 = 0;
    temp3 = 0;
    compar1 = 2;
    compar2 = 5;
    compar3 = 3;
    compar4 = 25;
    for (int i = 0; i < list_modules.size();i++) {
        if (list_modules[i].m_type==M_OTHER){
            if (list_modules[i].m_weight<=-2 && list_modules[i].m_cost<=compar2 && list_modules[i].m_armor>=-1 && list_modules[i].m_prod_time<=compar1){
                temp1 = i;
                compar1=list_modules[i].m_prod_time;
                compar2=list_modules[i].m_cost;
            }
            if(list_modules[i].m_sight>=compar3 && list_modules[i].m_weight<=0 && list_modules[i].m_cost<=15 && list_modules[i].m_prod_time<=4){
                compar3 = list_modules[i].m_sight;
                temp2 = i;
            }
            if(list_modules[i].m_comm_reach>=compar4 && list_modules[i].m_weight<=1 && list_modules[i].m_cost<=15 && list_modules[i].m_prod_time<=4){
                compar4 = list_modules[i].m_comm_reach;
                temp3 = i;
            }
        }
    }
    m_ExplorateurVolant.m_module_array.push_back(list_modules[temp1]);
    m_ExplorateurVolant.m_module_array.push_back(list_modules[temp2]);
    if(compar3<6){
    m_ExplorateurVolant.m_module_array.push_back(list_modules[temp2]);
    }
    m_ExplorateurVolant.m_module_array.push_back(list_modules[temp3]);
        //




    //Explorateur:
    m_Explorateur.m_module_array.clear();
        //déplacements:
    temp1 = 0;
    compar1 = 20;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_MOVE){
            if (list_modules[i].m_speed<=2){
                if(list_modules[i].m_prod_time*3+list_modules[i].m_cost<=compar1){
                    temp1 = i;
                    compar1 = list_modules[i].m_prod_time*3+list_modules[i].m_cost;
                }
            }
        }
    }
    m_Explorateur.m_module_array.push_back(list_modules[temp1]);
    //armes:
    //autres:
    temp1 = 0;
    temp2 = 0;
    temp3 = 0;
    compar1 = 2;
    compar2 = 5;
    compar3 = 3;
    compar4 = 25;
    for (int i = 0; i < list_modules.size();i++) {
        if (list_modules[i].m_type==M_OTHER){
            if (list_modules[i].m_weight<=-2 && list_modules[i].m_cost<=compar2 && list_modules[i].m_armor>=-1 && list_modules[i].m_prod_time<=compar1){
                temp1 = i;
                compar1=list_modules[i].m_prod_time;
                compar2=list_modules[i].m_cost;
            }
            if(list_modules[i].m_sight>=compar3 && list_modules[i].m_weight<=0 && list_modules[i].m_cost<=15 && list_modules[i].m_prod_time<=4){
                compar3 = list_modules[i].m_sight;
                temp2 = i;
            }
            if(list_modules[i].m_comm_reach>=compar4 && list_modules[i].m_weight<=1 && list_modules[i].m_cost<=15 && list_modules[i].m_prod_time<=4){
                compar4 = list_modules[i].m_comm_reach;
                temp3 = i;
            }
        }
    }
    m_Explorateur.m_module_array.push_back(list_modules[temp1]);
    m_Explorateur.m_module_array.push_back(list_modules[temp2]);
    if(compar3<6){
    m_Explorateur.m_module_array.push_back(list_modules[temp2]);
    }
    m_Explorateur.m_module_array.push_back(list_modules[temp3]);
        //



    //CaC:
    m_CaC.m_module_array.clear();
        //déplacements:
    temp1 = 0;
    compar1 = 3;
    compar2 = 0;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_MOVE){
            if (list_modules[i].m_speed<=compar1){
                if (list_modules[i].m_cost<=compar2){
                    temp1 = i;
                    compar1 = list_modules[i].m_speed;
                    compar2 = list_modules[i].m_cost;
                }
            }
        }
    }
    std::cout<<temp1<<"\n";
    m_CaC.m_module_array.push_back(list_modules[temp1]);
        //armes:
    temp1 = 0;
    compar1 = 2;
    compar2 = 3;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_WEAPON){
             if (list_modules[i].m_weight<=compar1){
                if (list_modules[i].m_attack>=compar2 && list_modules[i].m_min_reach<=1) {
                    temp1 = i;
                    compar1 = list_modules[i].m_weight;
                    compar2 = list_modules[i].m_attack;
                }
            }
        }
    }
    m_CaC.m_module_array.push_back(list_modules[temp1]);
        //


//archer:
    m_Archer.m_module_array.clear();
        //déplacements:
    temp1 = 0;
    compar1 = 25;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_MOVE){
            if (list_modules[i].m_speed==1){
                if(list_modules[i].m_prod_time*3+list_modules[i].m_cost<=compar1){
                    temp1 = i;
                    compar1 = list_modules[i].m_prod_time*3+list_modules[i].m_cost;
                }
            }
        }
    }
    m_Archer.m_module_array.push_back(list_modules[temp1]);
    //armes:
    temp1 = 0;
    compar1 = 2;
    compar2 = 3;
    compar3 = 3;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_WEAPON){
            if (list_modules[i].m_weight<=compar1){
                if (list_modules[i].m_attack>=compar2 && list_modules[i].m_max_reach>=compar3 && list_modules[i].m_min_reach <=2){
                    temp1 = i;
                    compar1 = list_modules[i].m_weight;
                    compar2 = list_modules[i].m_attack;
                }
            }
        }
    }
    m_Archer.m_module_array.push_back(list_modules[temp1]);
    //autres:
    temp1 = 0;
    compar1 = 20;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_OTHER){
            if (list_modules[i].m_weight==-2){
                if (list_modules[i].m_prod_time*3+list_modules[i].m_cost<=compar1){
                    temp1 = i;
                    compar1 = list_modules[i].m_prod_time*3+list_modules[i].m_cost;
                }
            }
            if(list_modules[i].m_sight>=compar3 && list_modules[i].m_weight<=0 && list_modules[i].m_cost<=15 && list_modules[i].m_prod_time<=4){
                compar3 = list_modules[i].m_sight;
                temp2 = i;
            }
        }
    }
    m_Archer.m_module_array.push_back(list_modules[temp1]);
    m_Archer.m_module_array.push_back(list_modules[temp1]);
    if(compar3>3){
    m_Archer.m_module_array.push_back(list_modules[temp2]);
    }
        //



    //archer volant:
    m_ArcherVolant.m_module_array.clear();

        //déplacements:
    temp1 = 0;
    compar1 = 2;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_MOVE){
            if (list_modules[i].m_aerial){
                if (list_modules[i].m_speed<=compar1){
                    temp1 = i;
                    compar1 = list_modules[i].m_speed;
                }
            }
        }
    }
    m_ArcherVolant.m_module_array.push_back(list_modules[temp1]);
    //armes:
    temp1 = 0;
    compar1 = 2;
    compar2 = 3;
    compar3 = 3;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_WEAPON){
            if (list_modules[i].m_weight<=compar1){
                if (list_modules[i].m_attack>=compar2 && list_modules[i].m_max_reach>=compar3 && list_modules[i].m_min_reach <=2){
                    temp1 = i;
                    compar1 = list_modules[i].m_weight;
                    compar2 = list_modules[i].m_attack;
                }
            }
        }
    }

    m_ArcherVolant.m_module_array.push_back(list_modules[temp1]);
    //autres:
    temp1 = 0;
    compar1 = 20;
    for (int i = 0; i< list_modules.size();i++) {
        if (list_modules[i].m_type==M_OTHER){
            if (list_modules[i].m_weight==-2){
                if (list_modules[i].m_prod_time*3+list_modules[i].m_cost<=compar1){
                    temp1 = i;
                    compar1 = list_modules[i].m_prod_time*3+list_modules[i].m_cost;
                }
            }
            if(list_modules[i].m_sight>=compar3 && list_modules[i].m_weight<=0 && list_modules[i].m_cost<=15 && list_modules[i].m_prod_time<=4){
                compar3 = list_modules[i].m_sight;
                temp2 = i;
            }
        }
    }
    m_ArcherVolant.m_module_array.push_back(list_modules[temp1]);
    m_ArcherVolant.m_module_array.push_back(list_modules[temp1]);
    if(compar3>3){
    m_ArcherVolant.m_module_array.push_back(list_modules[temp2]);
    }




/*R_Model pas encore fait
            R_Model m_Radio;*/

}



void IA_Factory::afficheResultat(){
    std::cout<<"Modele de guerrier au Corps a corps:"<<"\n";
    for (int i = 0; i<m_CaC.m_module_array.size();i++){
        toStringModel(m_CaC.m_module_array[i]);
        std::cout<<"\n";
    }
    std::cout<<"Modele de fermier rapide:"<<"\n";
    for (int i = 0; i<m_Peon.m_module_array.size();i++){
        toStringModel(m_Peon.m_module_array[i]);
        std::cout<<"\n";
    }
    std::cout<<"Modele de fermier volant:"<<"\n";
    for (int i = 0; i<m_PeonVolant.m_module_array.size();i++){
        toStringModel(m_PeonVolant.m_module_array[i]);
        std::cout<<"\n";
    }
    std::cout<<"Modele d'explorateur:"<<"\n";
    for (int i = 0; i<m_Explorateur.m_module_array.size();i++){
        toStringModel(m_Explorateur.m_module_array[i]);
        std::cout<<"\n";
    }
    std::cout<<"Modele d'explorateur volant:"<<"\n";
    for (int i = 0; i<m_ExplorateurVolant.m_module_array.size();i++){
        toStringModel(m_ExplorateurVolant.m_module_array[i]);
        std::cout<<"\n";
    }
    std::cout<<"Modele d'archer:"<<"\n";
    for (int i = 0; i<m_Archer.m_module_array.size();i++){
        toStringModel(m_Archer.m_module_array[i]);
        std::cout<<"\n";
    }
    std::cout<<"Modele d'archer volant:"<<"\n";
    for (int i = 0; i<m_ArcherVolant.m_module_array.size();i++){
        toStringModel(m_ArcherVolant.m_module_array[i]);
        std::cout<<"\n";
    }
    std::cout<<"Modele de chinois:"<<"\n";
    for (int i = 0; i<m_Chinois.m_module_array.size();i++){
        toStringModel(m_Chinois.m_module_array[i]);
        std::cout<<"\n";
    }
    std::cout<<"Modele de chinois volant:"<<"\n";
    for (int i = 0; i<m_ChinoisVolant.m_module_array.size();i++){
        toStringModel(m_ChinoisVolant.m_module_array[i]);
        std::cout<<"\n";
    }
    std::cout<<"Modele de japonais:"<<"\n";
    for (int i = 0; i<m_Japonais.m_module_array.size();i++){
        toStringModel(m_Japonais.m_module_array[i]);
        std::cout<<"\n";
    }

}

void IA_Factory::toStringModel(R_Module m_truc){
    std::cout<<" "<<m_truc.m_type<<" "<<m_truc.m_cost<<" "<<m_truc.m_weight<<" "<<m_truc.m_prod_time<<" "<<m_truc.m_speed<<" "<<m_truc.m_energy<<" "<<m_truc.m_energy_regen<<" "<<m_truc.m_health_point<<" "<<m_truc.m_attack_time<<" "<<m_truc.m_attack_energy<<" "<<m_truc.m_attack<<" "<<m_truc.m_attack_time<<" "<<m_truc.m_attack_energy<<" "<<m_truc.m_min_reach<<" "<<m_truc.m_max_reach<<" "<<m_truc.m_comm_reach<<" "<<m_truc.m_sight<<" "<<m_truc.m_armor<<" "<<m_truc.m_explosive<<" "<<m_truc.m_aerial<<" "<<m_truc.m_jammer<<" "<<m_truc.m_cargo_size<<"  "<<m_truc.m_name;
}



std::vector<R_Module> IA_Factory::initTest (){
    std::vector<R_Module> ret;
    R_Module nouveau;

    //Jambes
//Commun à tous les modules
nouveau.m_name = "Jambes";
nouveau.m_type = M_MOVE;
nouveau.m_cost = 0;
nouveau.m_weight = 0;
nouveau.m_prod_time = 1;
// Déplacement
nouveau.m_speed = 3;
nouveau.m_aerial = false;
//Utilitaire énergitique
nouveau.m_energy = 0;
nouveau.m_energy_regen = 0;
nouveau.m_comm_reach = 0;
nouveau.m_sight = 0;
nouveau.m_explosive = 0;
nouveau.m_jammer = false;
nouveau.m_cargo_size = 0;
// Armes
nouveau.m_attack_time = 0;
nouveau.m_attack_energy = 0;
nouveau.m_attack = 0;
nouveau.m_min_reach = 0;
nouveau.m_max_reach = 1;
// Structure
nouveau.m_health_point = 0;
nouveau.m_armor = 0;
ret.push_back(nouveau);

//Roues
nouveau.m_name = "Roues";
nouveau.m_cost = 5;
nouveau.m_speed = 2;
ret.push_back(nouveau);
//Aéroglisseur
nouveau.m_name = "Aeroglisseur";
nouveau.m_cost = 15;
nouveau.m_speed = 1;
ret.push_back(nouveau);
/* TEST 1
//aeroglisseur améliorés:
nouveau.m_name = "Aeroglisseurs amélioré";
nouveau.m_cost = 10;
ret.push_back(nouveau);
nouveau.m_name = "Aéroglisseur amélioré 2";
nouveau.m_cost = 12;
ret.push_back(nouveau);
*/
//Ailes
nouveau.m_name = "Ailes";
nouveau.m_cost = 10;
nouveau.m_speed = 2;
nouveau.m_aerial = true;
ret.push_back(nouveau);
//Reset
nouveau.m_speed = 0; //Reset
nouveau.m_aerial = false; //Reset


//Armes
nouveau.m_type = M_WEAPON;
//Massue
nouveau.m_name = "Massue";
nouveau.m_weight = 1;
nouveau.m_cost = 0;
nouveau.m_prod_time = 1;
nouveau.m_attack_time = 3;
nouveau.m_attack_energy = 3;
nouveau.m_attack = 3;
ret.push_back(nouveau);
/* TEST 2
nouveau.m_name = "grosse Massue";
nouveau.m_weight = 15;
nouveau.m_attack = 15;
ret.push_back(nouveau);
*/
//Arbalète laser
nouveau.m_name = "arbalète";
nouveau.m_weight = 2;
nouveau.m_cost = 5;
nouveau.m_prod_time = 2;
nouveau.m_attack_time = 5;
nouveau.m_attack_energy = 8;
nouveau.m_attack = 3;
nouveau.m_min_reach = 2;
nouveau.m_max_reach = 6;
ret.push_back(nouveau);
//Reset
nouveau.m_attack_time = 0; //Reset
nouveau.m_attack_energy = 0; //Reset
nouveau.m_attack = 0; //Reset
nouveau.m_min_reach = 0; //Reset
nouveau.m_max_reach = 1; //Reset


//Utilitaire
nouveau.m_type = M_OTHER;
//Soute
nouveau.m_name = "soute";
nouveau.m_cost = 2;
nouveau.m_weight = 1;
nouveau.m_prod_time = 1;
nouveau.m_cargo_size = 5;
ret.push_back(nouveau);
nouveau.m_cargo_size = 0; //Reset
//Senseurs
nouveau.m_name = "senseur";
nouveau.m_cost = 5;
nouveau.m_weight = 0;
nouveau.m_prod_time = 2;
nouveau.m_sight = 3;
ret.push_back(nouveau);
/* TEST 3
nouveau.m_name = "senseur lourd";
nouveau.m_weight = 2;
nouveau.m_sight = 6;
ret.push_back(nouveau);
*/
nouveau.m_sight = 0; //Reset

//Radio / Com
nouveau.m_name = "radio";
nouveau.m_cost = 5;
nouveau.m_weight = 1;
nouveau.m_prod_time = 2;
nouveau.m_comm_reach = 25;
ret.push_back(nouveau);
nouveau.m_comm_reach = 0; //Reset
//Poudre
nouveau.m_name = "poudre";
nouveau.m_cost = 5;
nouveau.m_weight = 1;
nouveau.m_prod_time = 0;
nouveau.m_explosive = 15;
ret.push_back(nouveau);
nouveau.m_explosive = 0; //Reset


//Structure
// Chassis de tôle
nouveau.m_name = "chassis de tôle";
nouveau.m_cost = -3;
nouveau.m_weight = 0;
nouveau.m_prod_time = -1;
nouveau.m_health_point = -5;
ret.push_back(nouveau);
// Carapace recyclée
nouveau.m_name = "carapace recyclé";
nouveau.m_cost = -3;
nouveau.m_weight = 1;
nouveau.m_prod_time = 4;
nouveau.m_health_point = 2;
ret.push_back(nouveau);
// Tas de métal partout
nouveau.m_name = "tas de métal partout";
nouveau.m_cost = 4;
nouveau.m_weight = 2;
nouveau.m_prod_time = 2;
nouveau.m_health_point = 5;
ret.push_back(nouveau);
nouveau.m_health_point = 0; //Reset
// Alliages légers
nouveau.m_name = "alliages lègers";
nouveau.m_cost = 5;
nouveau.m_weight = -2;
nouveau.m_prod_time = 2;
nouveau.m_armor = -1;
ret.push_back(nouveau);
// Blindage
nouveau.m_name = "blindage";
nouveau.m_cost = 10;
nouveau.m_weight = 5;
nouveau.m_prod_time = 2;
nouveau.m_armor = 2;
ret.push_back(nouveau);
nouveau.m_armor = 0; //Reset




return ret;

}

